package com.muyu.system.domain.model;

import com.muyu.common.core.web.model.QueryModel;
import com.muyu.system.domain.req.SysPostListReq;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;


/**
 * 参数配置 分页 模型
 */

@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class SysPostPageQueryModel  extends QueryModel<SysPostPageQueryModel> {
    /**
     * 岗位编码
     */
    private String postCode;

    /**
     * 岗位名称
     */
    private String postName;

    /**
     * 状态（0正常 1停用）
     */
    private String status;

    public static SysPostPageQueryModel reqBuild(SysPostListReq sysPostListReq) {
        SysPostPageQueryModel sysPostPageQueryModel = SysPostPageQueryModel.builder()
                .postCode(sysPostListReq.getPostCode())
                .postName(sysPostListReq.getPostName())
                .status(sysPostListReq.getStatus())
                .build();
        sysPostPageQueryModel.domainBuild(sysPostListReq);
        return sysPostPageQueryModel;
    }
}
